-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asynchronous threading phase2 #3771
Conversation
…factored its use that it only gets used inside of syscalls
…have no stack pointer
Co-authored-by: Syrus Akbary <[email protected]>
…asmer into asynchronous-threading-phase2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need that thread local?
If we really do need it, we can guard against bugs by storing some thread-relevant value in the thread local and panic on a mismatch.
(We can just store the whole WasiThread, since it's clone, and do Arc::ptr_eq for equality)
(rather than making the functions unsafe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need that thread local?
If we really do need it, we can guard against bugs by storing some thread-relevant value in the thread local and panic on a mismatch.
(We can just store the whole WasiThread, since it's clone, and do Arc::ptr_eq for equality)
(rather than making the functions unsafe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much cleaner now without the thread locals!
Rebase failed
…asmer into asynchronous-threading-phase2
This patch does a series of refactoring to prevent similar bugs to the one that was found in the asynchronous threading patch.
In particular:
inner()
is scoped to the wasi module and no longer usable outsideinner()
is marked asunsafe
and any use of it is audited and wrapped with unsafeWasiEnv
no longer copies theinner()